package com.gitee.wsl.func.ext

import com.gitee.wsl.func.BiCallAbleFun
import com.gitee.wsl.func.SuspendBiCallAbleFun

// arrow.core curried 用于分解函数 进行 分步调用

fun <P1, P2, R> BiCallAbleFun<P1,P2,R>.curried(): (P1) -> (P2) -> R =
    { p1: P1 -> { p2: P2 -> this(p1, p2) } }

fun <P1, P2, R> SuspendBiCallAbleFun<P1,P2,R>.curried():  (P1) -> suspend (P2) -> R =
    { p1: P1 -> { p2: P2 -> this(p1, p2) } }